Skip to content

Replace String.join with String.repeat for generating placeholders in TableMetaDataContext #33364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

luckygc
Copy link

@luckygc luckygc commented Aug 10, 2024

Replaced the use of String.join combined with Collections.nCopies to generate SQL placeholders with the more concise and efficient String.repeat method.

  • This change simplifies the code and improves readability.
  • Performance might be slightly improved as String.repeat is more direct.

No functionality change; only a refactoring to improve code clarity and efficiency.

Benchmark Mode Cnt Score Error Units
JoinTest.nCopies thrpt 5 5938.720 ± 84.293 ops/ms
JoinTest.repeat thrpt 5 37268.560 ± 1977.043 ops/ms

…holders

Replaced the use of String.join combined with Collections.nCopies to generate SQL placeholders with the more concise and efficient String.repeat method.

- This change simplifies the code and improves readability.
- Performance might be slightly improved as String.repeat is more direct.

No functionality change; only a refactoring to improve code clarity and efficiency.

Benchmark          Mode  Cnt      Score      Error   Units
JoinTest.nCopies  thrpt    5   5938.720 ±   84.293  ops/ms
JoinTest.repeat   thrpt    5  37268.560 ± 1977.043  ops/ms
@pivotal-cla
Copy link

@luckygc Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@luckygc Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 10, 2024
@sbrannen sbrannen added the in: data Issues in data modules (jdbc, orm, oxm, tx) label Aug 10, 2024
@sbrannen sbrannen changed the title refactor: replace String.join with String.repeat for generating place… Replace String.join with String.repeat for generating placeholders in TableMetaDataContext Aug 10, 2024
@luckygc luckygc closed this Aug 10, 2024
@luckygc luckygc deleted the luckygc-patch-1 branch August 10, 2024 14:54
@bclozel bclozel added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged or decided on in: data Issues in data modules (jdbc, orm, oxm, tx) labels Aug 10, 2024
@sbrannen
Copy link
Member

@luckygc, please note that there is no need to close a PR and open a new one (##33365) identical to the previous one (this PR).

Instead, you can push additional commits to the existing PR.

@sbrannen sbrannen added in: data Issues in data modules (jdbc, orm, oxm, tx) status: superseded An issue that has been superseded by another and removed status: declined A suggestion or change that we don't feel we should currently apply labels Aug 11, 2024
@luckygc
Copy link
Author

luckygc commented Aug 11, 2024

@sbrannen Thank you for the guidance. I understand now and will make sure to push additional commits to the existing PR next time instead of creating a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) status: superseded An issue that has been superseded by another
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants